import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter);

const routes = [{
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/item',
    name: 'Item',
    component: () => import('../views/Item.vue'),
      children: [
          {
              path: '',
              name: 'chunks',
              component: () => import('../components/chunks.vue'),
          },
          {
              path: 'patch',
              name: 'patch',
              component: () => import('../components/patch.vue'),
          },
          {
              path: 'productList',
              name: 'productList',
              component: () => import('../components/productList.vue'),
          }
      ]
  },
  {
    path: '/exercise',
    name: 'Exercise',
    component: () => import('../views/Exercise.vue')
  },
  {
    path: '/shop',
    name: 'Shop',
    component: () => import('../views/Shop.vue')
  },
  {
    path: '/mine',
    name: 'Mineall',
    component: () => import('../views/Mine.vue'),
    children:[
      {
        path: '',
        name: 'Mineall1',
        component: () => import('../views/Mineall.vue'),
      },
      {
        path: 'myoder',
        name: 'MyOder',
        component: () => import('../views/MyOder.vue'),
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/mine',
    name: 'Mine',
    component: () => import('../views/Mine.vue'),
    children:[
      {
        path:'addressManagement',
        name:'AddressManagement',
        component: ()=> import('../components/AddressManagement.vue')
      }
    ]
  },
  {
      path: '/details',
      name: 'details',
      component: () => import('../views/details.vue')
    },
];

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes,
  linkActiveClass: '',
  linkExactActiveClass: 'router-link-active'
});

export default router
